from typing import List
class Solution:
    def PredictTheWinner(self, nums: List[int]) -> bool:
        def helper(left, right):
            if left == right:
                return nums[left]
            
            leftV = nums[left] - helper(left+1, right)
            rightV = nums[right] - helper(left, right-1)

            return max(leftV, rightV)
        
        return helper(0, len(nums)-1) >= 0